// File: jmcomic-core/src/main/java/dev/jukomu/jmcomic/exception/ResponseUnexpectedException.java
package dev.jukomu.jmcomic.exception;

import dev.jukomu.common.util.net.IResponse;

import java.util.Map;

/**
 * 对应Python的ResponseUnexpectedException，表示HTTP响应不符合预期。
 */
public class ResponseUnexpectedException extends JmcomicException {
    public static final String DESCRIPTION = "响应不符合预期异常";

    public ResponseUnexpectedException(String message, Map<String, Object> context) {
        super(message, context);
    }

    public ResponseUnexpectedException(String message, Map<String, Object> context, Throwable cause) {
        super(message, context, cause);
    }

    /**
     * 获取导致异常的响应对象。
     *
     * @return IResponse对象
     */
    public IResponse getResp() {
        return fromContext(ExceptionUtils.CONTEXT_KEY_RESP);
    }
}